package com.cy.pj.module.controller;

import com.cy.pj.module.pojo.ResponseResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;

@Controller
public class JsonController {
    @RequestMapping("/docovertResponseToJson")
    @ResponseBody
    public ResponseResult docovertResponseToJson() {
        ResponseResult result = new ResponseResult();
        result.setCode(200);
        result.setMessage("Ok");
        return result;
    }
    @RequestMapping("/doConvertMapToJson")
    public Map<String,Object> doConvertMapToJson(){
        Map<String,Object> map=new HashMap<>();
        map.put("username","jason");
        map.put("state",true);
        return map;
    }
}
